# import matplotlib.pyplot as plt
from matplotlib import pyplot as plt
import random

# Draw a line chart
x_list_01 = range(1, 50)
y_list_01 = [random.randint(0, 30) for i in x_list_01]
y_list_02 = [random.randint(10, 40) for i in x_list_01]
plt.figure(figsize=(20, 15), dpi=80)
# for i in range(0, 10):
#     y_list_01.append(random.randrange(1, 100, 1))
# Set the x-axis scale
# plt.xticks(x_list_01)
# x_tick = ["{}:00".format(i) for i in x_list_01]
# plt.xticks(x_list_01, x_tick)
plt.xticks(range(1, 50), rotation=0)
# Set the y-axis scale
y_tick = ["{}°C".format(i) for i in range(min(y_list_01), max(y_list_02) + 1)]
plt.yticks(range(min(y_list_01), max(y_list_02) + 1), y_tick)
plt.xlim(xmin=0, xmax=50)
plt.ylim(ymin=0, ymax=40)
# Set the line format of a line chart
plt.plot(x_list_01, y_list_01, color="red", alpha=0.5,
         linestyle="--", linewidth=5, marker="o",
         markersize="10", label="self")
plt.plot(x_list_01, y_list_02, color="blue", alpha=0.5,
         linestyle="--", linewidth=5, marker="*",
         markersize="10", label="mate")
# Add grid
plt.grid(alpha=0.5)
# Add legend
plt.legend(loc="upper right")
# Set the graph label
plt.title("Picture")
# Set x-axis label
plt.xlabel("temperature")
# Set y-axis label
plt.ylabel("time")
plt.savefig("./random_01.jpg")
plt.show()
